﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DormMS.Model;
using DormMS.IService;
using Infrastructure.Dao;
using SqlSugar;

namespace DormMS.Service
{
    public class DormAdjustService : IDormAdjustService
    {
        private SqlSugarClient db;

        public List<DormAdjust> GetDormAdjust(int Id)
        {
            using (db = DbConfig.GetInstance())
            {
                db.CurrentFilterKey = "";
                return db.Queryable<DormAdjust>().Where(d => d.Id == Id).ToList();
            }
        }

        public int AddDormAdjust(DormAdjust model)
        {
            using (db = DbConfig.GetInstance())
            {
                return db.Insert<DormAdjust>(model).ObjToInt();
            }
        }
    }
}
